package controller;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import model.CardapioDAO;
import model.bean.CardapioBean;

public class CardapioController {
	
	public static String[] cardapiosNomes(){
		 ArrayList itens = CardapioDAO.getCardapiosNomes();
		 String[] cardapios = new String[itens.size()] ;
		 for (int i = 0; i < cardapios.length; i++) {
			cardapios[i] = ((Object[]) itens.get(i))[0].toString();
		}
		return cardapios;
	}
	public static String[] getNomeCardapios(){
		List<CardapioBean> cardapios = CardapioDAO.getCardapios();
		String[] nomes = new String[cardapios.size()];
		for (int i = 0; i < nomes.length; i++) {
			nomes[i] = cardapios.get(i).getNome();
		}
		return nomes;
	}
	public static List<CardapioBean> getCardapios(){
		return CardapioDAO.getCardapios();
	}
	public static CardapioBean getCardapioPorNome(String nome){
		return CardapioDAO.getCardapioPorNome(nome);
	}
}
